package com.bjim.model;



import com.bjim.common.BaseModel;

import cn.dreampie.orm.annotation.Table;

/**
 * 用户群组关系映射表
 * @author chen
 *
 */
@Table(name="ts_usergroup")
public class UserGroup extends BaseModel<UserGroup> {
	public static UserGroup dao=new UserGroup();
	
	/**
	 * 根据群组id，userid查找关系
	 * @param groupid
	 * @param userid
	 * @return
	 */
	public Group findGroup(int groupid,String userid){
		Group group=Group.dao.findFirst("select a.*,b.isnotify,b.isadmin,b.istop from ts_group a,ts_usergroup b where a.groupid=? and a.groupid=b.groupid and b.userid=?  ",groupid,userid);
		return group;
	}
}
